package cn.net.wanji.config;

import cn.net.wanji.entity.SiteInfo;
import cn.net.wanji.service.DataReceiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *刷新站点数据定时任务
 * @Author : yangliang
 * @create 2022/11/2 10:16
 */
@Component
public class RefreshSignageDataJob {
    @Autowired
    private DataReceiveService dataReceiveService;
    public static List<SiteInfo> siteInfoList;
    @PostConstruct
    public void selectData(){
        //siteInfoList = siteInfoService.selectAll();
        siteInfoList = dataReceiveService.listAllSiteInfos(new SiteInfo());
//        System.out.println(siteInfoList);
    }
    public void clearCache(){
        siteInfoList = null;
    }
}
